<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2018/10/18
 * Time: 13:49
 */

namespace app\api\model;


class WorkdepartmentWorkuser extends BaseModel
{

    protected $hidden=['update_time','create_time'];
    protected $autoWriteTimestamp = true;
    /**
     * 根据部门id获取成员
     * @param $d_id
     * @return false|\PDOStatement|string|\think\Collection
     */
    public static function getUserByDepartmentId($d_id){
        $orderProduct =  self::where('department_id','=',$d_id)->select();
        return $orderProduct;
    }

    /**
     * 根据用户id获取部门
     * @param $user_id
     * @return false|\PDOStatement|string|\think\Collection
     */
    public static function getDepartmentByUserId($user_id){
        $orderProduct =  self::where('user_id','=',$user_id)->select();
        return $orderProduct;
    }

    public static function getDepartment($user,$department_id){
       return self::where('user_id','=',$user)->select();
    }



}